﻿@{
    ViewBag.Title = "Login";
    Page.CheckApp = false;
}

<form method="post" id="form1">
<br />
<input type="hidden" id="Force" name="Force" value="0" />
<table cellpadding="0" cellspacing="0" border="0" style="width:95%; margin:0 auto;">
    <tr>
        <td style="width:70px; height:45px; text-align:right;">帐号：</td>
        <td><input type="text" class="mytext" id="Account" name="Account" value="" maxlength="50" style="width:170px;" /></td>
    </tr>
    <tr>
        <td style="height:45px; text-align:right;">密码：</td>
        <td><input type="password" class="mytext" id="Password" name="Password" maxlength="50" style="width:170px;" /></td>
    </tr>
    <tr id="novcode" style="display:none;">
        <td style="height:45px; text-align:right;">验证码：</td>
        <td><input type="text" class="mytext" id="VCode" name="VCode" maxlength="4" style="width:80px;" />
            <img alt="" src="VCode?@DateTime.Now.Ticks" onclick="cngimg();" style="vertical-align:middle;" id="VcodeImg" />
        </td>
    </tr>
    <tr>
        <td>&nbsp;</td>
        <td><input type="submit" value="确认登录" class="mybutton" onclick="return checkForm();" /></td>
    </tr>
    <tr>
        <td>&nbsp;</td>
        <td style="text-align:left; vertical-align:bottom; height:23px;"><span style="color:#999; margin-right:10px;">用户名:xh 密码:111</span><a href="http://www.cqroad.cn" target="_blank"><span style="color:#999;">官网:cqroad.cn</span></a></td>
    </tr>
</table>
</form>
<script type="text/javascript">
    var isVcode = '1' == '@Session[ViewBag.IsVcodeSessionKey]';
    $(function ()
    {
        if (isVcode)
        {
            top.win.resize(300, 230);
            $("#novcode").show();
        }
        @Html.Raw(ViewBag.ErrMsg)
        @Html.Raw(ViewBag.Forcescript)
    });
    function checkForm()
    {
        var form1 = document.forms[0];
        if ($.trim(form1.Account.value).length == 0)
        {
            alert("帐号不能为空!");
            form1.Account.focus();
            return false;
        }
        if ($.trim(form1.Password.value).length == 0)
        {
            alert("密码不能为空!");
            form1.Password.focus();
            return false;
        }
        if (isVcode && form1.VCode && $.trim(form1.VCode.value).length == 0)
        {
            alert("验证码不能为空!");
            form1.VCode.focus();
            return false;
        }
        return true;
    }
    function cngimg()
    {
        $('#VcodeImg').attr('src', 'VCode?' + new Date().toString());
    }
</script>
